<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	 <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
	<title>微信安全支付</title>

	<style>
		*{
			margin:0;
			padding: 0;
			list-style: none;
		}
		.content{
			width:100%;
			position: relative;
		}

		.back{
			width:100%;
			height:100%;
			position: absolute;
			top:0;
			left: 0;
			z-index: 2;
			background-color: #ccc;
			opacity: .8;
		}

		.pays{
			width:80%;
			height:60%;
			position: absolute;
			top:20%;
			margin-left: -40%;
			margin-top:-20%;
			left: 50%;
			border-radius: 20px;
			z-index: 10;
			background-color: #fff;
		}

		.pays>ul{
			width:92%;
			height:68%;
			margin:0 auto;
		}
	
		.pays>ul>li{
			width:100%;
			height:23%;
			/*border-bottom: 1px solid #F6F6F6;*/
		}

		.pays>ul>li img{
			width:12%;
			float: left;
			margin:20px 0 0 0px;
		}
		
		label{
			width:23%;
			float: left;
			margin-top: 25px;
			color: #A3A3A3;
			padding-left: 3%;
			font-size: .8em;
			text-align:right;
		}

		.inp{
			height:60%;
			margin-top: 1%;
			width:55%;
			padding-top: 8px;
			float: right;
			border:none;
			outline: none;
		}
		.bac{
			margin-top:20px;
		}
	</style>
	<script>
	function onBridgeReady(){
	   WeixinJSBridge.invoke(
	       'getBrandWCPayRequest', 
	       <?php echo $jsApiParameters; ?>,
	       function(res){     
	           if(res.err_msg == "get_brand_wcpay_request:ok" ) {
					location.href="http://www.alywt.com/index.php/Weixin/Order/checkStatus.html";
	           		//document.getElementById("id").html=res;				
	             }else if(res.err_msg == "get_brand_wcpay_request:cancel"){
	             	alert("用户取消支付!"); 
	             }else{
	                //返回跳转到订单详情页面
	                alert("支付失败");
	                //location.href="http://www.gdddac.com/daodao/index.php/Weixin/Index/rescue.html";
			   	}   // 使用以上方式判断前端返回,微信团队郑重提示：res.err_msg将在用户支付成功后返回    ok，但并不保证它绝对可靠。 
	       }
	   ); 
	}
	function callpay(){
		if (typeof WeixinJSBridge == "undefined"){
			if( document.addEventListener ){
		       document.addEventListener('WeixinJSBridgeReady', onBridgeReady, false);
		   }else if (document.attachEvent){
		       document.attachEvent('WeixinJSBridgeReady', onBridgeReady); 
		       document.attachEvent('onWeixinJSBridgeReady', onBridgeReady);
		   }
		}else{
		   onBridgeReady();
		}
	}	
	</script>
</head>
<body>
	<nav class="mui-bar mui-bar-tab"></nav>
	<div class="content">
		<div class="back"></div>		
		<div class="pays">
			<ul>
				<li style="">
					<p onclick="window.history.back();" class="bac"><span style="text-align: left;padding-left: 20px;color:#52C878;font-size: 1em;">返回</span></p>
					<br/>
					<p style="width:100%;text-align: center;"><span style="color: #1E1C22;font-size: 1.3em;">微信安全支付</span></p>
				</li>
				<li style="margin-top:30px;">
					<img src="WEIXIN_URL/img/金额@2x.png" alt="" style="width:30px;">
					<label for="" style="text-align:right;">金额</label>
					<input type="text" name="" id="" class="inp" style="color: #A3A3A3;width:40%;padding-top: 8px; text-align:right;float:left;border:none;outline: none;font-size:2rem"value="{{$_SESSION['money']}}">
				</li>
			</ul>
			<div style="text-align:center;width:100%;margin-top: 10px;">
			<button style="width:210px; height:30px; background-color:#52C878; border:0px #FE6714 solid; cursor: pointer;  color:white;  font-size:16px;" type="button" onclick="callpay()" >确认支付</button>
			</div>
		</div>
	</div>
	<script src="http://apps.bdimg.com/libs/jquery/2.1.1/jquery.min.js"></script>
	<script>
		window.onload=function(){
			$(".content").height($(window).height());
			$(window).resize(function(){
				$(".content").height($(window).height());
			});
		}
	</script>
</body>
</html>